var cameraPositionX = 7;
var cameraPositionY = 7;
var cameraPositionZ = 7;
var rotation = 0;
var rotation_pos_x = 0;
var rotation_pos_y = 0;
var rotation_pos_z = 0;

var lightPositionX = 0;
var lightPositionY = 0;
var lightPositionZ = 2;

var shinness = 150;

var limit = 0.5;

var indicesArray = [
  0,
  1,
  2,
  0,
  2,
  3, // front
  4,
  5,
  6,
  4,
  6,
  7, // right
  8,
  9,
  10,
  8,
  10,
  11, // up
  12,
  13,
  14,
  12,
  14,
  15, // left
  16,
  17,
  18,
  16,
  18,
  19, // down
  20,
  21,
  22,
  20,
  22,
  23, // back
];

var normalsArray = [
  0.0,
  0.0,
  1.0,
  0.0,
  0.0,
  1.0,
  0.0,
  0.0,
  1.0,
  0.0,
  0.0,
  1.0, // v0-v1-v2-v3 front
  1.0,
  0.0,
  0.0,
  1.0,
  0.0,
  0.0,
  1.0,
  0.0,
  0.0,
  1.0,
  0.0,
  0.0, // v0-v3-v4-v5 right
  0.0,
  1.0,
  0.0,
  0.0,
  1.0,
  0.0,
  0.0,
  1.0,
  0.0,
  0.0,
  1.0,
  0.0, // v0-v5-v6-v1 up
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0, // v1-v6-v7-v2 left
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0, // v7-v4-v3-v2 down
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0,
  0.0,
  0.0,
  -1.0, // v4-v7-v6-v5 back
];

var colorsArray = [
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v0-v1-v2-v3 front
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v0-v3-v4-v5 right
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v0-v5-v6-v1 up
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v1-v6-v7-v2 left
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v7-v4-v3-v2 down
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v4-v7-v6-v5 back

  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v0-v1-v2-v3 front
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v0-v3-v4-v5 right
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v0-v5-v6-v1 up
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v1-v6-v7-v2 left
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v7-v4-v3-v2 down
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  1, // v4-v7-v6-v5 back
];

function GetVerticesArray() {
  var verticesArray = [
    0.5,
    0.5,
    0.5,
    -0.5,
    0.5,
    0.5,
    -0.5,
    -0.5,
    0.5,
    0.5,
    -0.5,
    0.5, // v0-v1-v2-v3 front
    0.5,
    0.5,
    0.5,
    0.5,
    -0.5,
    0.5,
    0.5,
    -0.5,
    -0.5,
    0.5,
    0.5,
    -0.5, // v0-v3-v4-v5 right
    0.5,
    0.5,
    0.5,
    0.5,
    0.5,
    -0.5,
    -0.5,
    0.5,
    -0.5,
    -0.5,
    0.5,
    0.5, // v0-v5-v6-v1 up
    -0.5,
    0.5,
    0.5,
    -0.5,
    0.5,
    -0.5,
    -0.5,
    -0.5,
    -0.5,
    -0.5,
    -0.5,
    0.5, // v1-v6-v7-v2 left
    -0.5,
    -0.5,
    -0.5,
    0.5,
    -0.5,
    -0.5,
    0.5,
    -0.5,
    0.5,
    -0.5,
    -0.5,
    0.5, // v7-v4-v3-v2 down
    0.5,
    -0.5,
    -0.5,
    -0.5,
    -0.5,
    -0.5,
    -0.5,
    0.5,
    -0.5,
    0.5,
    0.5,
    -0.5, // v4-v7-v6-v5 back
  ];
  return verticesArray;
}

var texcoordArray = [
  // left column front
  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,

  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,

  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,

  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,

  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,

  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,

  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,

  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,
  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,
  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,
  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,
  0,
  1,
  0,
  0,
  1,
  0,
  1,
  1,
];



var indicesFloorArray = [
  8,
  9,
  10,
  8,
  10,
  11 // up
  
];